package com.census.entity;

import javax.persistence.*;

/**
 * Created by WangKai's Hands.
 * User:WangKai
 * Date:2017/7/9
 * Time:14:11
 * Email: 1786025737@qq.com
 */
@Entity
@Table(name = "tm_area", schema = "census", catalog = "")
public class TmArea {
    private long id;
    private String area;
    private int cityId;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "area")
    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    @Basic
    @Column(name = "city_id")
    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TmArea tmArea = (TmArea) o;

        if (id != tmArea.id) return false;
        if (cityId != tmArea.cityId) return false;
        if (area != null ? !area.equals(tmArea.area) : tmArea.area != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (area != null ? area.hashCode() : 0);
        result = 31 * result + cityId;
        return result;
    }
}
